package com.ruoyi.web.controller.config;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.ViewConfigPushMes;
import com.ruoyi.system.service.ViewConfigPushMesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("view/config/push/mes")
public class ViewConfigPushMesController extends BaseController {

    @Autowired
    private ViewConfigPushMesService viewConfigPushMesService;

    /**
     * 分页查询
     *
     * @return 查询结果
     */
    @GetMapping("/list")
    public TableDataInfo queryByPage() {
        startPage();
        List<ViewConfigPushMes> list = viewConfigPushMesService.queryByViewKey(new ViewConfigPushMes());
        return getDataTable(list);
    }


    /**
     * 编辑数据
     *
     * @param viewConfigPushMes 实体
     * @return 编辑结果
     */
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody ViewConfigPushMes viewConfigPushMes) {
        this.viewConfigPushMesService.updateViewConfigPushMes(viewConfigPushMes);
        return AjaxResult.success();
    }

}
